
/**
*This software is under LGPL license,
*see http://www.gnu.org/licenses/lgpl-3.0.txt (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>)
*Console.h First issued by chuanshenglu@gmail.com 2008.10
*/

#ifndef __WIN32CONSOLE_H__
#define __WIN32CONSOLE_H__

#include "trstd.h"
#include "Console.h"

namespace TR{
	////Win32Console implements a console abstraction on 32-bit  Windows platform////
	class Win32Console:public Console{
	protected:
		HANDLE mOutputHandle;
		HANDLE mInputHandle;
		HANDLE mErrorHandle;
	private:
	public:
		Win32Console();
		virtual ~Win32Console();

		virtual void EnterMainLoop();
		virtual void OnKeyboardEvent(KeyboardEvent);
		virtual void OnFocusEvent(FocusEvent);

		virtual BOOL MoveCursor(Coord);
		virtual void	ShowCursor(BOOL);

		virtual BOOL WriteChar(Coord,TCHAR);
		virtual BOOL WriteLine(Coord,const String&);
		virtual TCHAR GetChar(Coord);

		//Gets and sets
		virtual BOOL SetTitle(const String&);
		virtual BOOL SetTitle(const TCHAR*);
	};
}

#endif